<template>
  <button :disabled="disabled" :class="'i-button-size' + size">
    <slot>搜索</slot>
    <slot name="icon"></slot>
  </button>
</template>

<script>
function oneOf(val, validList) {
  for (let i = 0; i < validList.length; i++) {
    if (validList[i] === val) {
      return true;
    }
  }
  return false;
}

export default {
  props: {
    size: {
      validator(value) {
        return oneOf(value, ["small", "large", "default"]);
      },
      default: "default",
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  methods: {
    test(e) {
      console.log(123);
      console.log(e);
    },
  },
};
</script>

<style>
</style>